import pygame

fileName = raw_input("Drag the file you want to parse to the following colon, then press enter :").strip("\"")
imageToParse = pygame.image.load(fileName)
imagesPerColumn = input("Enter the number of images in a column in the image to be parsed : ")
imageHeight = imageToParse.get_height()
imageWidth = imageToParse.get_width()
finalHeight = imageHeight / imagesPerColumn
raw_input("Height of each subTexture is calculated to be %i pixels. Press Enter to continue."%(finalHeight))
destImage = pygame.Surface((imageWidth * imagesPerColumn, finalHeight), 0, imageToParse)
pygame.display.set_mode((1,1))
imageToParse = imageToParse.convert_alpha(destImage)

for i in xrange(0,imagesPerColumn):
    destImage.blit(imageToParse, (imageWidth * i, -1 * finalHeight * i))

pygame.image.save(destImage, "cool.png")